import pandas as pd
import pymysql

## 加上字符集参数，防止中文乱码
dbconn = pymysql.connect(
    host="gz-cdb-ezvn7csl.sql.tencentcdb.com",
    database="bailun_bltpro",
    user="root",
    password="shengye2021",
    port=58892,
    charset='utf8'
)

# sql语句
sqlcmd = "select Description from t_bi_walmart_listing_crawler limit 20"

# 利用pandas 模块导入mysql数据
a = pd.read_sql(sqlcmd, dbconn)
# 取前5行数据
b = a.head(10)
print(b,type(b))

# 读取csv数据
# pd.read_csv()

# 读取excel数据
# pd.read_excel()

# 读取txt数据
# pd.read_table()